@(id: Long, computerForm: Form[Computer], companies : Seq[(String, String)])(implicit messages: Messages)

@import helper._

@implicitFieldConstructor: FieldConstructor = @{ FieldConstructor(twitterBootstrapInput.f) }

@main {
    
    <h1>Edit computer</h1>
    
    @form(routes.Application.update(id)) {
        
        <fieldset>
        
            @inputText(computerForm("name"), Symbol("_label") -> "Computer name")
            @inputText(computerForm("introduced"), Symbol("_label") -> "Introduced date")
            @inputText(computerForm("discontinued"), Symbol("_label") -> "Discontinued date")
            
            @select(
                computerForm("company"), 
                companies, 
                Symbol("_label") -> "Company", Symbol("_default") -> "-- Choose a company --",
                Symbol("_showConstraints") -> false
            )
        
        </fieldset>
        
        <div class="actions">
            <input type="submit" value="Save this computer" class="btn primary"> or 
            <a href="@routes.Application.list()" class="btn">Cancel</a> 
        </div>
        
    }
    
    @form(routes.Application.delete(id), Symbol("class") -> "topRight") {
        <input type="submit" value="Delete this computer" class="btn danger">
    }
    
}
